package cn.edu.thsis.service.impl;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import cn.edu.thsis.dao.UserDao;
import cn.edu.thsis.dao.impl.UserDaoImpl;
import cn.edu.thsis.pojo.User;
import cn.edu.thsis.pojo.student;
import cn.edu.thsis.pojo.teacher;
import cn.edu.thsis.pojo.thsis;
import cn.edu.thsis.service.UserService;

public class UserServiceImpl implements UserService{
	//声明Dao层对象
	UserDao ud = new UserDaoImpl();
	//用户登录
	@Override
	public User checkUserLoginService(String uid, String pwd, String type) throws SQLException {
		return ud.chexkUserLoginDao(uid, pwd,type);
	}
	@Override
	public student findStuService(String uid, String type) throws SQLException {
		// TODO Auto-generated method stub
		return (student) ud.findUserDao(uid, type);
	}
	@Override
	public teacher fidTeaService(String uid, String type) throws SQLException {
		// TODO Auto-generated method stub
		return (teacher) ud.findUserDao(uid, type);
	}
	//修改用户密码
	@Override
	public int userChangePwdService(String newPwd, String uid,String type) throws SQLException {
		return ud.userChangePwdDao(newPwd,uid,type);
	}
	//获取教师信息
	@Override
	public List<teacher> teaShowService() throws SQLException {
		return ud.teaShowDao();
	}
	@Override
	public int addteaService(teacher teahr) {
		// TODO Auto-generated method stub
		return ud.addteaDao(teahr);
	}
	@Override
	public int addstuService(student stud) {
		// TODO Auto-generated method stub
		return ud.addstuDao(stud);
	}
	//获取学生信息
	@Override
	public List<student> stuShowService() throws SQLException {
		// TODO Auto-generated method stub
		return ud.stuShowDao();
	}
	//删除教师
	@Override
	public int delteaService(String uid) throws SQLException {
		// TODO Auto-generated method stub
		return ud.delteaDao(uid);
	}
	//删除学生
	@Override
	public int delstuService(String uid) throws SQLException {
		// TODO Auto-generated method stub
		return ud.delstuDao(uid);
	}
	//学生预约注册论题
	@Override
	public int doEnrolService(String thsis_id, String stu_id) throws SQLException {
		// TODO Auto-generated method stub
		return ud.doEnrolDao(thsis_id,stu_id);
	}
	
	//得到已预约本论题学生列表
	@Override
	public List<student> doAcceptService(String thsis_id) throws SQLException {
		// TODO Auto-generated method stub
		return ud.doAcceptDao(thsis_id);
	}
	@Override
	public int addthService(thsis the) {
		// TODO Auto-generated method stub
		return ud.addthDao(the);
	}
	//查看未选题的学生
	@Override
	public List<student> stuthService() throws SQLException {
		// TODO Auto-generated method stub
		return ud.stuthDao();
	}
	//查看未出题的教师
	@Override
	public List<teacher> teathService() throws SQLException {
		// TODO Auto-generated method stub
		return ud.teathDao();
	}
	//接受学生选择该论题
	@Override
	public int okService(String thsis_id,String stu_id) throws SQLException {
		// TODO Auto-generated method stub
		return ud.okDao(thsis_id,stu_id);
	}
	//教师查看自己的论题
	@Override
	public List<thsis> myService(String uid) throws SQLException {
		// TODO Auto-generated method stub
		return ud.mythDao(uid);
	}
	//拒绝学生选择该论题
	@Override
	public int noService(String thsis_id, String stu_id) throws SQLException {
		// TODO Auto-generated method stub
		return ud.noDao(thsis_id,stu_id);
	}
	//催促学生选题
	@Override
	public int warnService(String id) throws SQLException {
		// TODO Auto-generated method stub
		return ud.warnstu(id);
	}
	//催促教师出题
	@Override
	public int warnteaService(String id) throws SQLException {
		// TODO Auto-generated method stub
		return ud.warnteaDao(id);
	}
	//查看所有论题信息
	@Override
	public List<thsis> allthes() throws SQLException {
		// TODO Auto-generated method stub
		return ud.allthesdao();
	}
}
